package com.clouddot.baipai.ui.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.clouddot.baipai.R;
import com.clouddot.baipai.http.entity.response.getClassRecordResponse;

import java.util.List;

/**
 * Created by wxy on 2018/8/26.
 */

public class V_ClassRecordAdapter extends BaseQuickAdapter<getClassRecordResponse, BaseViewHolder> {


    public V_ClassRecordAdapter(List<getClassRecordResponse> mDataList) {
        super(R.layout.v_adapter_classattend_item, mDataList);
    }

    @Override
    protected void convert(BaseViewHolder helper, getClassRecordResponse item) {
        helper.setText(R.id.tv_name, item.studentname);

        if (item.cardtimes > 0) {
            helper.setText(R.id.tv_status, "已签到");
            helper.setBackgroundRes(R.id.tv_status, R.color.class_left);
        } else {
            helper.setText(R.id.tv_status, "未签到");
            helper.setBackgroundRes(R.id.tv_status, R.color.gray);
        }

    }

}
